#include "settings.h"

settingQDialog::settingQDialog(QWidget *parent) : QDialog(parent)
{
    ui = new Ui::Dialog();
    ui->setupUi(this);
    setWindowTitle("设置");
    loadSettings();
    connect(ui->mouseFov, &QSlider::valueChanged, this, [this]()
            { ui->mouseFov_lable->setText(QString::number(ui->mouseFov->value())); });
    connect(ui->mouseSensitivity, &QSlider::valueChanged, this, [this]()
            { ui->mouseSensitivity_lable->setText(QString::number(ui->mouseSensitivity->value())); });
}

settingQDialog::~settingQDialog()
{
}
void settingQDialog::loadSettings()
{
    ui->mouseFov->setValue(sets.value("mouseFov", 80).toFloat());
    ui->mouseSensitivity->setValue(sets.value("mouseSensitivity", 15).toFloat());
    ui->mouseFov_lable->setText(QString::number(ui->mouseFov->value()));
    ui->mouseSensitivity_lable->setText(QString::number(ui->mouseSensitivity->value()));
    ui->image_preloading->setChecked(sets.value("image_preloading", true).toBool());
}
